<style lang="less">
  @import './login.less';
</style>

<template>
  <div class="login">
    <div class="login-con">
      <Card icon="log-in" title="欢迎登录" :bordered="false">
        <div class="form-con">
          <login-form @on-success-valid="handleSubmit"></login-form>
          
        </div>
      </Card>
    </div>
  </div>
</template>

<script>
import LoginForm from '_c/login-form'
import { mapActions } from 'vuex'
import { setToken} from '@/libs/util'
export default {
  components: {
    LoginForm
  },
  methods: {
    ...mapActions([
      'handleLogin',
      'getUserInfo'
    ]),
    handleSubmit ({ userName, password }) {
    	if(userName!='admin'){
    		this.$Message.error('账号错误...');
    		return false
    	}
    	if(password!='123456'){
    		this.$Message.error('密码错误...');
    		return false
    	}   
    	setToken('admin')
      this.$router.push({
        name: this.$config.homeName
      })    	
    }
  }
}
</script>

<style>

</style>
